<extend name="./Application/Admin/View/common/base.html" />
<block name="crumb">
    <span class="c-gray en">&gt;</span> 充值中心
    <span class="c-gray en">&gt;</span> 充值方式
</block>
<block name="content">
    <div class="tabBar cl m-b-10">
        <span class="current"><a href="{:U('Account/account_type')}">充值方式</a></span>
    </div>

    <div class="mt-10">
        <table class="table table-border table-bordered table-bg table-sort table-hover">
            <form action="{:U('Agent/batchDo')}" method="post" id="batch_do">
                <thead>

                <tr class="text-c">
                    <th>序号</th>
                    <th>类型名称</th>
                    <th>介绍</th>
                    <th>版本</th>
                    <th>费用</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name="accountlist" id="account">
                    <tr class="text-c">
                        <td>{$i}</td>
                        <td>{$account['agent_name']}</td>
                        <td>{$account['amount']}</td>
                        <td>{$payType[$account['pay_type']]}</td>
                        <td>{$account['record_time']|date='Y-m-d',###}</td>
                        <td>
                            <if condition="$account['audit_status'] eq '0'">
                                <a href="{:U('Account/account_audit',array('id'=>$account['account_id']))}" class="label label-success">审核</a>
                                <else/>
                                <span class="label">已审</span>
                            </if>
                        </td>
                    </tr>
                </volist>
                </tbody>
            </form>
        </table>
    </div>
    <div class="page" style="margin-top: 10px;">{$page}</div>
</block>

<!--自己的css和js-->
<block name="css">
    <link href="__PUBLIC__/Admin/static/ext/css/zoomify.css" rel="stylesheet" type="text/css" />
</block>
<block name="js">
    <script type="text/javascript">
        $(function(){
            $('.changeS').click(function ()
            {
                var do_type = $(this).attr("do");
                layer.confirm('您确认进行此操作吗？', {
                    btn: ['确认','取消']
                }, function(){
                    $("#do_type").attr("value", do_type);
                    $("#batch_do").submit();
                });
            });
        });
        // 关闭用户
        function closeAgent( $agent_id)
        {
            layer.confirm('您确认关闭此用户吗，他将无法再登陆系统？', {
                btn: ['确认','取消']
            }, function(){
                $.ajax({
                    url: "{:U('Agent/closeAgent')}",
                    type: "post",
                    dataType:'JSON',
                    data: {agent_id: $agent_id},
                    beforeSend: function () {
                        layer.msg('关闭中..', {icon: 16,time:500});
                    },
                    success: function (msg)
                    {
                        if(msg.status == 'success'){
                            location.reload(true);
                        }else{
                            layer.alert(msg.msg);
                        }
                    }
                });
            });
        }
    </script>
</block>